import Vue from 'vue'
import Router from 'vue-router'
import main from './modules/main' //首页

import spaceBusiness from './modules/spaceBusiness'
import dailyService from './modules/dailyService'
import baseOption from './modules/baseOption'
import operation from './modules/operation' //运营管理


import welcome from './modules/welcome' //欢迎页
/*
import course from './modules/old/course'//早教课程
import operation from './modules/old/operation' //运营管理
import seller from './modules/old/seller' //销售管理
import user from './modules/old/user' //用户管理
import goods from './modules/old/goods' //商品管理
import order from './modules/old/order' //订单管理
import finance from './modules/old/finance' //财务管理
import data from './modules/old/data' //数据管理
import system from './modules/old/system' //系统管理*/


Vue.use(Router)

/**
 * hidden: true                   为true时不会在侧边栏展示，默认值为false
 * alwaysShow: true               设置为true，会一直在根菜单展示，不管是否有子路由
 * redirect: noredirect           在面包屑中将不会重定向
 * name:'router-name'             <keep-alive>中使用，请设置
 * meta : {
    title: 'title'               左侧菜单和面包屑中展示
    icon: 'svg-name'             左侧菜单中展示
  }
 **/
export const asynRouterMap = [
  welcome,
  main,
  spaceBusiness,
  // dailyService,
  // baseOption,
  // operation,

  /*course,
  operation,
  seller,
  user,
  goods,
  order,
  finance,
  data,
  system,*/
  //登录
  { path: '/login', name: 'login', component: () => import('@/views/login/index') },
  //404页面
  { path: '/404', name: 'notFound', component: () => import('@/views/404') }
]
export const constantRouterMap = [
  //登录
  { path: '/login', name: 'login', component: () => import('@/views/login/index') },
  //404页面
  { path: '/404', name: 'notFound', component: () => import('@/views/404') }
]
export default new Router({
  mode: 'history', // 后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: asynRouterMap
  // routes: constantRouterMap
})
